﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Graphics;

namespace Theta.Managers
{
    public class ContentManager
    {
        Dictionary<string, Image> imageCache = new Dictionary<string, Image>(); 

        public void CacheImage(string path)
        {
            path = FixPath(path);
            if (!imageCache.ContainsKey(path))
            {
                Image img = new Image(path);
                imageCache.Add(path, img);
            }
        }

        public Image GetImage(string path)
        {
            path = FixPath(path);
            CacheImage(path);
            return imageCache[path];
        }

        internal string FixPath(string path)
        {
            string s = path;
            s.Replace(@"\", "/");
            return s;

        }
    }
}
